<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');
/*
  | -------------------------------------------------------------------------
  | URI ROUTING
  | -------------------------------------------------------------------------
  | This file lets you re-map URI requests to specific controller functions.
  |
  | Typically there is a one-to-one relationship between a URL string
  | and its corresponding controller class/method. The segments in a
  | URL normally follow this pattern:
  |
  |	example.com/class/method/id/
  |
  | In some instances, however, you may want to remap this relationship
  | so that a different class/function is called than the one
  | corresponding to the URL.
  |
  | Please see the user guide for complete details:
  |
  |	http://codeigniter.com/user_guide/general/routing.html
  |
  | -------------------------------------------------------------------------
  | RESERVED ROUTES
  | -------------------------------------------------------------------------
  |
  | There area two reserved routes:
  |
  |	$route['default_controller'] = 'welcome';
  |
  | This route indicates which controller class should be loaded if the
  | URI contains no data. In the above example, the "welcome" class
  | would be loaded.
  |
  |	$route['404_override'] = 'errors/page_missing';
  |
  | This route will tell the Router what URI segments to use if those provided
  | in the URL cannot be matched to a valid route.
  |
 */
global $CFG;
$config = $CFG->config;
$langs_abbr = implode('?.(\/)*|', array_keys($config['lang_abbr']));
$langs_abbr .="?.(\/)*";

$route['default_controller'] = "c_mainpage";
$route['404_override'] = '';
$route['(' . $langs_abbr . ')'] = $route['default_controller'];

$route['(' . $langs_abbr . '|)main'] = 'c_mainpage';

$route['(' . $langs_abbr . '|)journal'] = 'c_mainpage/journal';

$route['(' . $langs_abbr . '|)journal/admin'] = 'c_admin';
$route['(' . $langs_abbr . '|)journal/admin/groups'] = 'c_admin/show_groups';
$route['(' . $langs_abbr . '|)journal/admin/groups/add'] = 'c_admin/add_group';
$route['(' . $langs_abbr . '|)journal/admin/groups/edit/(:num)'] = 'c_admin/edit_group/$5';
$route['(' . $langs_abbr . '|)journal/admin/groups/nominate-subjects'] = 'c_admin/show_nominate_subjects';
$route['(' . $langs_abbr . '|)journal/admin/groups/nominate-subjects/add'] = 'c_admin/add_nominate_subjects';
$route['(' . $langs_abbr . '|)journal/admin/students'] = 'c_admin/show_students';
$route['(' . $langs_abbr . '|)journal/admin/students/add'] = 'c_admin/add_student';
$route['(' . $langs_abbr . '|)journal/admin/students/edit/(:num)'] = 'c_admin/edit_student/$5';
$route['(' . $langs_abbr . '|)journal/admin/subjects'] = 'c_admin/show_subjects';
$route['(' . $langs_abbr . '|)journal/admin/subjects/add'] = 'c_admin/add_subject';
$route['(' . $langs_abbr . '|)journal/admin/subjects/edit/(:num)'] = 'c_admin/edit_subject/$5';
$route['(' . $langs_abbr . '|)journal/admin/teachers'] = 'c_admin/show_teachers';
$route['(' . $langs_abbr . '|)journal/admin/teachers/add'] = 'c_admin/add_teacher';
$route['(' . $langs_abbr . '|)journal/admin/teachers/edit/(:num)'] = 'c_admin/edit_teacher/$5';

$route['(' . $langs_abbr . '|)journal/visits'] = 'c_visits';
$route['(' . $langs_abbr . '|)journal/visits/([a-z]._[0-9]+)'] = 'c_visits/show_one_group/$5';
$route['(' . $langs_abbr . '|)journal/visits/([a-z]._[0-9]+)/([a-z]{3}.{1}[0-9]+)'] = 'c_visits/show_one_subject/$5/$6';
$route['(' . $langs_abbr . '|)journal/visits/([a-z]._[0-9]+)/([a-z]{3}.{1}[0-9]+)/add_date'] = 'c_visits/add_subject_day/$5/$6';
$route['(' . $langs_abbr . '|)journal/visits/([a-z]._[0-9]+)/([a-z]{3}.{1}[0-9]+)/add_visit'] = 'c_visits/add_visit/$5/$6';
$route['(' . $langs_abbr . '|)journal/visits/([a-z]._[0-9]+)/([a-z]{3}.{1}[0-9]+)/edit_visit'] = 'c_visits/edit_visit/$5/$6';
$route['(' . $langs_abbr . '|)journal/visits/([a-z]._[0-9]+)/([a-z]{3}.{1}[0-9]+)/edit_day'] = 'c_visits/edit_subject_day/$5/$6';
$route['(' . $langs_abbr . '|)journal/visits/([a-z]._[0-9]+)/([a-z]{3}.{1}[0-9]+)/delete_day'] = 'c_visits/delete_subject_day/$5/$6';

$route['(' . $langs_abbr . '|)journal/scores'] = 'c_scores';

$route['(' . $langs_abbr . '|)journal/rating'] = 'c_rating';
$route['(' . $langs_abbr . '|)journal/rating/([a-z]._[0-9]+)'] = 'c_rating/show_one_group/$5';
$route['(' . $langs_abbr . '|)journal/rating/([a-z]._[0-9]+)/([a-z]{3}.{1}[0-9]+)'] = 'c_rating/show_one_subject/$5/$6';
$route['(' . $langs_abbr . '|)journal/rating/([a-z]._[0-9]+)/([a-z]{3}.{1}[0-9]+)/edit_lectures'] = 'c_rating/edit_lectures/$5/$6';
$route['(' . $langs_abbr . '|)journal/rating/([a-z]._[0-9]+)/([a-z]{3}.{1}[0-9]+)/edit_practices'] = 'c_rating/edit_practices/$5/$6';
$route['(' . $langs_abbr . '|)journal/rating/([a-z]._[0-9]+)/([a-z]{3}.{1}[0-9]+)/edit_module'] = 'c_rating/edit_module/$5/$6';
$route['(' . $langs_abbr . '|)journal/rating/([a-z]._[0-9]+)/([a-z]{3}.{1}[0-9]+)/edit_sci'] = 'c_rating/edit_science_work/$5/$6';

$route['(' . $langs_abbr . '|)help'] = 'c_mainpage/help';
$route['(' . $langs_abbr . '|)about'] = 'c_mainpage/about';
$route['(' . $langs_abbr . '|)feedback'] = 'c_mainpage/feedback';

/* End of file routes.php */
/* Location: ./application/config/routes.php */